package com.tvserials.notification.preferences;

import android.app.Activity;
import android.graphics.Point;
import android.util.Log;
import com.tvserials.notification.R;
import com.espian.showcaseview.ShowcaseView;
import com.espian.showcaseview.targets.ActionItemTarget;

/**
 * Created by Alex on 01.04.2014.
 */
public class ShowCaseManager {

    public static ShowcaseView showCaseAllSerials(Activity activity) {
        try {
            ActionItemTarget target = new ActionItemTarget(activity, R.id.btnAccept);
            Point point = target.getPoint();
            ShowcaseView.ConfigOptions options = new ShowcaseView.ConfigOptions();
            return ShowcaseView.insertShowcaseView(target, activity, R.string.showcase2_title, R.string.showcase2_details, options);
        } catch (Exception e) {
            Log.w("Main", "do nothing " + e);
        }
        return null;
    }

    public static ShowcaseView showCaseSerials(Activity activity) {
        try {
            ActionItemTarget target = new ActionItemTarget(activity, R.id.menuSign);
            Point point = target.getPoint();
            ShowcaseView.ConfigOptions options = new ShowcaseView.ConfigOptions();

            ShowcaseView showcaseView = ShowcaseView.insertShowcaseView(target, activity, R.string.showcase_title, R.string.showcase_details, options);
            return showcaseView;
        } catch (Exception e) {
            Log.w("Main", "failed to get target for showcase, ignore the error " + e);
        }
        return null;
    }
}
